__author__ = 'xinrong'

import os

fid=open("./code", "r+")

data={}
while True:
    line = fid.readline()
    if not line:
        break
    lst=line.split('\t')
    data[lst[2]]=[lst[0]]

print(data)

for i in range(1, 101):
    if i < 10:
        name = "00000" + str(i)
    elif i < 100:
        name = "0000" + str(i)
    else:
        name = "000" + str(i)
    if not data.has_key(name):
        try:
            os.remove("./files/"+name)
            print(name)
        except WindowsError:
            print('except\t'+name)

